import sys

def readFile():
	for arg in sys.argv[1:]:
		f = open(arg, 'r')
	except IOError:
		print 'cannot open', arg
	else:
		print arg, 'has', len(f.readlines()), lines'
		f.close()

if __name__ == "__main__"
	readFile()
